home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / GLUT-3.7 / README.MUI < prev    next >
Encoding:
Text File  |  1998-08-12  |  3.7 KB  |  92 lines

  1. GLUT users wanting a GLUT user interface toolkit,
  2.  
  3. Tom Davis (an SGI founder) has contributed his micro-UI toolkit ported
  4. to GLUT.  With this user interface library, it should be possible to
  5. write an OpenGL application with a very asthetically pleasing user
  6. interface.
  7.  
  8. See the subdirectories:
  9.  
  10.   lib/mui
  11.   test/mui
  12.   progs/mui
  13.  
  14. The micro-UI is "as is" and currently doesn't have any documentation
  15. beyond the short description below written by Tom.
  16.  
  17. - Mark Kilgard
  18.   July 16, 1997
  19.  
  20. Here's some experimental code for a micro-ui (MUI).
  21.  
  22. The code that draws the widgets is taken from the old Showcase "libui",
  23. and has been ported to OpenGL.  The showcase code had routines to draw
  24. the various widgets in many "states" -- selected, highlighted, inactive,
  25. et cetera.
  26.  
  27. The philosophy behind MUI is to provide a ui library with multiple
  28. levels of access.  At the lowest level, if you just want to draw pretty
  29. buttons and handle all the interaction yourself, it should provide
  30. that.  But if you'd like to make a list of the widgets and have the
  31. code do locate-highlight as your mouse passes over the buttons and make
  32. callbacks when buttons are pressed or sliders are slid, it should
  33. provide that too.
  34.  
  35. You should also be able to work at intermediate levels.  For example,
  36. the Showcase libui has "radio buttons", where a bunch of them are linked
  37. together, and if you press one, the previously pressed button is
  38. released.  But if you'd like to use these for a non-radio-like purpose
  39. becasue you like the way they look, you can do so, but you'll have to
  40. manually control which ones are activated.
  41.  
  42. There's no layout tool (although I have some ideas on that topic --
  43. I'll try to add them to this someday), so you have to give the
  44. coordinates of all the widgets.
  45.  
  46. I have not yet ported all the Showcase libui widgets.  So far the list
  47. of ported widgets includes:
  48.  
  49.     generic buttons
  50.     radio buttons
  51.     tiny radio buttons
  52.     labels
  53.     bold labels
  54.     vertical sliders
  55.     horizontal sliders
  56.     text entry fields
  57.     scrolling text blocks (for selecting file names, for example)
  58.     pull-down menu (*)
  59.  
  60. (*) Actually, I just provide the menu bar, and what gets activated are
  61. the GLUT pop-up menues.  It works fine, except that the GLUT pop-ups are
  62. not drawn in the same style as the rest of the MUI widgets.
  63.  
  64. There's one very weird thing in the code -- the MUI always draws stuff
  65. using a sort of display list -- usually a very short display list.  The
  66. reason for this is that the Showcase libui was designed to run on
  67. systems with as few as 16 colors.  To get a bigger variety of colors in
  68. the 16 color case, it would draw things twice with 2 different colors
  69. and 2 different stipple patterns.  So to draw pink if it only had red
  70. and white, it would draw half the pixels in red, change the stipple to
  71. hit the other bits, and then draw the same thing in white.  If the
  72. system had good color capability, it would just draw in pink.
  73.  
  74. I've tossed out the code that did multiple drawing, but the display list
  75. structure is ubiquitous, so I didn't bother to rip it out yet.  I
  76. shouldn't take too long; I wanted to get all the widgets ported first
  77. and then I figured I'd do the whole thing at once rather than
  78. piece-meal.
  79.  
  80. I just don't want anyone to conclude that I'm a moron because of the
  81. obviously inefficient drawing code.  (There are pleny of other features
  82. of the code you can use to see if I'm really a moron :^)
  83.  
  84. The code hasn't been cleaned up in the sense that I'd like to have the
  85. only visible external names begin with "mui_".  I'd also like to make
  86. sure that the only include file you'll need is mui.h.  And mui.h still
  87. exposes too much.  I've only used it for a small number of examples
  88. (about 3) of applications, and each new one I do causes me to clean
  89. things up a bit more.
  90.  
  91.   -- Tom Davis (davis@sgi.com)
  92.